/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.eurotrader.entidades;

import br.com.eurotrader.interfaces.InterfaceEntidades;
import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Edmilson
 */
@Entity
@Table(name = "ordemdeservico")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Ordemdeservico.findAll", query = "SELECT o FROM Ordemdeservico o"),
    @NamedQuery(name = "Ordemdeservico.findById", query = "SELECT o FROM Ordemdeservico o WHERE o.id = :id"),
    @NamedQuery(name = "Ordemdeservico.findBySituacao", query = "SELECT o FROM Ordemdeservico o WHERE o.situacao = :situacao"),
    @NamedQuery(name = "Ordemdeservico.findByDataCadastro", query = "SELECT o FROM Ordemdeservico o WHERE o.dataCadastro = :dataCadastro"),
    @NamedQuery(name = "Ordemdeservico.findByDataHoraFechamento", query = "SELECT o FROM Ordemdeservico o WHERE o.dataHoraFechamento = :dataHoraFechamento"),
    @NamedQuery(name = "Ordemdeservico.findByDataHoraInicio", query = "SELECT o FROM Ordemdeservico o WHERE o.dataHoraInicio = :dataHoraInicio"),
    @NamedQuery(name = "Ordemdeservico.findByObservacao", query = "SELECT o FROM Ordemdeservico o WHERE o.observacao = :observacao")})
public class Ordemdeservico implements Serializable, InterfaceEntidades {
  
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Size(max = 1)
    @Column(name = "situacao")
    private String situacao;
    @Column(name = "dataCadastro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dataCadastro;
    @Column(name = "dataHoraFechamento")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dataHoraFechamento;
    @Column(name = "dataAgendamento")
    @Temporal(TemporalType.DATE)
    private Date dataAgendamento;
    @Column(name = "horaAgendamento")
    @Temporal(TemporalType.TIME)
    private Date horaAgendamento;
    @Column(name = "dataHoraInicio")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dataHoraInicio;
    @Size(max = 400)
    @Column(name = "observacao")
    private String observacao;
    @JoinColumn(name = "usuario_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Usuario usuarioId;
    @JoinColumn(name = "usuarioCriou_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Usuario usuarioCriouId;
    @JoinColumn(name = "empresa_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Empresa empresaId;
   

    public Ordemdeservico() {
    }

    public Usuario getUsuarioCriouId() {
        return usuarioCriouId;
    }

    public void setUsuarioCriouId(Usuario usuarioCriouId) {
        this.usuarioCriouId = usuarioCriouId;
    }
    
    public Ordemdeservico(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getSituacao() {
        return situacao;
    }

    public void setSituacao(String situacao) {
        this.situacao = situacao;
    }

    public Date getDataCadastro() {
        return dataCadastro;
    }

    public void setDataCadastro(Date dataCadastro) {
        this.dataCadastro = dataCadastro;
    }

    public Date getDataHoraFechamento() {
        return dataHoraFechamento;
    }

    public void setDataHoraFechamento(Date dataHoraFechamento) {
        this.dataHoraFechamento = dataHoraFechamento;
    }

    public Date getDataAgendamento() {
        return dataAgendamento;
    }

    public void setDataAgendamento(Date dataAgendamento) {
        this.dataAgendamento = dataAgendamento;
    }

    public Date getHoraAgendamento() {
        return horaAgendamento;
    }

    public void setHoraAgendamento(Date horaAgendamento) {
        this.horaAgendamento = horaAgendamento;
    }

    public Date getDataHoraInicio() {
        return dataHoraInicio;
    }

    public void setDataHoraInicio(Date dataHoraInicio) {
        this.dataHoraInicio = dataHoraInicio;
    }

    public String getObservacao() {
        return observacao;
    }

    public void setObservacao(String observacao) {
        this.observacao = observacao;
    }

    public Usuario getUsuarioId() {
        return usuarioId;
    }

    public void setUsuarioId(Usuario usuarioId) {
        this.usuarioId = usuarioId;
    }

    public Empresa getEmpresaId() {
        return empresaId;
    }

    public void setEmpresaId(Empresa empresaId) {
        this.empresaId = empresaId;
    }

   

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Ordemdeservico)) {
            return false;
        }
        Ordemdeservico other = (Ordemdeservico) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.eurotrader.entidades.Ordemdeservico[ id=" + id + " ]";
    }

  
    
}
